package com.msxt.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Date;

public class ChatMessage {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String consultBianhao;
    private String senderType;
    private String senderId;
    private String senderName;
    private String content;
    private String messageType;
    private Long timestamp;
    private Integer isRead;
    private Date createTime;

    public ChatMessage() {
        this.messageType = "text";
        this.isRead = 0;
    }

    public ChatMessage(String senderType, String content, String consultBianhao) {
        this();
        this.senderType = senderType;
        this.content = content;
        this.consultBianhao = consultBianhao;
        this.timestamp = System.currentTimeMillis();
        this.createTime = new Date();
    }

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getConsultBianhao() { return consultBianhao; }
    public void setConsultBianhao(String consultBianhao) { this.consultBianhao = consultBianhao; }

    public String getSenderType() { return senderType; }
    public void setSenderType(String senderType) { this.senderType = senderType; }

    public String getSenderId() { return senderId; }
    public void setSenderId(String senderId) { this.senderId = senderId; }

    public String getSenderName() { return senderName; }
    public void setSenderName(String senderName) { this.senderName = senderName; }

    public String getContent() { return content; }
    public void setContent(String content) { this.content = content; }

    public String getMessageType() { return messageType; }
    public void setMessageType(String messageType) { this.messageType = messageType; }

    public Long getTimestamp() { return timestamp; }
    public void setTimestamp(Long timestamp) { this.timestamp = timestamp; }

    public Integer getIsRead() { return isRead; }
    public void setIsRead(Integer isRead) { this.isRead = isRead; }

    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
}